//
//  ViewController.swift
//  Example
//
//  Created by 钟志远 on 2021/1/6.
//

import UIKit
import LWPopupViewController_Swift
import SnapKit

class ViewController: UIViewController {


    let btn = UIButton()
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.

        btn.setTitle("test", for: .normal)
        btn.addTarget(self, action: #selector(tap), for: .touchUpInside)
        view.addSubview(btn)
        
        btn.setTitleColor(.black, for: .normal)
        btn.snp.makeConstraints { (ConstraintMaker) in
            ConstraintMaker.center.equalToSuperview()
        }
    }

    @objc func tap() {
        let pop = LWPopupViewController()
        pop.animationContainer = LWPopupAnimationSheetStyle()
        let vc = PopupContentViewController()
        pop.addContent(viewController: vc)
//        pop.convenRetain(obj: self)
//
        pop.show(inViewController: self)
//
        
        vc.view.snp.remakeConstraints { (ConstraintMaker) in
            ConstraintMaker.height.equalTo(300)
            ConstraintMaker.bottom.left.right.equalToSuperview()
        }
        
//        self.present(pop, animated: true, completion: nil)
        
    }

}

